<html xmlns:concordion="http://www.concordion.org/2007/concordion">
    <head>
        <link href="../../../concordion.css" rel="stylesheet" type="text/css" />
    </head>
    <body>

        <h1>Stale Checkout Detection</h1>
    
        <p>
            The pool has a configurable checkout timeout.  If a connection
            remains checked out from the pool longer than this timeout, it will
            be closed and removed from the pool.
        </p>
        
        <div class="example">
        
            <ul>
                <li concordion:execute="#pool = createPoolWithCheckoutTimeout(#size, #checkoutTimeout)">A pool 
                with size <span concordion:set="#size">1</span> is created with a checkout timeout 
                of <span concordion:set="#checkoutTimeout">2</span> seconds</li>
                
                <li>A connection is <span concordion:execute="checkoutConnection(#pool)">checked out</span> from the pool and the number of available connections 
                is <span concordion:assertEquals="availableConnections(#pool)">0</span></li>
                
                <li>After <span concordion:set="#sleepTime">3</span> seconds the connection 
                is closed and removed from the pool.  The pool size is
                <span concordion:assertEquals="sleepAndGetAvailableConnections(#pool, #sleepTime)">1</span></li>
            </ul>
            
        </div>

    </body>
</html>